/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entities;

import org.newdawn.slick.Animation;
import org.newdawn.slick.Image;

/**
 *
 * @author wida46061976
 */
public class Panel extends EntityObject{
    public Panel(){
        setAnimation(new Animation());
        try {
            getAnimation().addFrame(new Image("resources/panel.png"), 1000);
            setPosX(890);
            setPosY(560);
            setPoly(getPosX(), getPosX() + 64, getPosY() + 27, getPosY() + 64);
            setActivated(false);
        } catch (Exception e) {
            System.out.println(e);
        }
    }
    public void touch(PlayableChar player) {
        if (getConnected().isActivated()) {
            System.out.println("des");
            getConnected().setActivated(false);
            getConnected().getAnimation().start();
        }else{
            System.out.println("act");
            getConnected().setActivated(true);
            getConnected().getAnimation().stop();
        }
    }
}
